package jkim.plugin.daframe.ext.sql.views;

import jkim.plugin.daframe.ext.sql.model.DaframeSQLLogInfo;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;

public class DaframeSQLSorter extends ViewerSorter {

	@Override
	public int compare(Viewer viewer, Object e1, Object e2) {
		int l1 = Integer.valueOf(((DaframeSQLLogInfo) e1).getLogNo());
		int l2 = Integer.valueOf(((DaframeSQLLogInfo) e2).getLogNo());
		if (l1 > l2) {
			return -1;
		} else if (l1 < l2) {
			return 1;
		}
		return 0;
	}

}